package com.lzw.breezeNovel.webApp.controller.video;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.model.entity.query.video.CategoryQuery;
import com.lzw.breezeNovel.webApp.service.video.VideoCategoryService;
import com.lzw.breezeNovel.webApp.vo.video.AnimeVo;
import com.lzw.breezeNovel.webApp.vo.video.MovieVo;
import com.lzw.breezeNovel.webApp.vo.video.TvSeriesVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller.video
 * @date 2025/3/18
 * @description 分类
 */
@RestController
@RequestMapping("/app/video/category")
@SuppressWarnings("all")
public class VideoCategoryController {

    /**
     * 注入service
     */
    @Autowired
    private VideoCategoryService videoCategoryService;

    /**
     * 分类获取动漫
     */
    @PostMapping("/getCategoryData")
    public Result<List<AnimeVo>> getCategoryData(@RequestBody CategoryQuery categoryQuery){
        List<AnimeVo> categoryData =  videoCategoryService.getCategoryData(categoryQuery);
       return Result.ok(categoryData);
    }

    /**
     * 分类获取电影
     */
    @PostMapping("/getMovieData")
    public Result<List<MovieVo>> getMovieData(@RequestBody CategoryQuery categoryQuery){
        List<MovieVo> movieData =  videoCategoryService.getMovieData(categoryQuery);
        return Result.ok(movieData);
    }

    /**
     * 分类获取电视剧
     */
    @PostMapping("/getTvSeriesData")
    public Result<List<TvSeriesVo>> getTvSeriesData(@RequestBody CategoryQuery categoryQuery){
        List<TvSeriesVo> tvSeries =  videoCategoryService.getTvSeriesData(categoryQuery);
        return Result.ok(tvSeries);
    }


}
